package sort;


import java.util.Random;

import sort.ShellSort.Sequence;

public class ShellSortTest {
    public static void main(String[] args) {
        Integer[] a = new Integer[100000];
        for (int i = 0; i < 100000; i++){
            Random r = new Random();
            a[i] = r.nextInt(100);
        }
        //System.out.println(Arrays.toString(a));
        long currentTimeMillis = System.currentTimeMillis();
        ShellSort.sort(a, Sequence.Hibbard);
        long finish = System.currentTimeMillis();
        //System.out.println(Arrays.toString(a));
        System.out.println("耗时"+(finish-currentTimeMillis) + "ms");
        for (int i = 0; i < 100000; i++){
            Random r = new Random();
            a[i] = r.nextInt(100);
        }
        ShellSort.sort(a, Sequence.ShellIncrement);
        long c = System.currentTimeMillis();
        System.out.println("耗时:" + (c - finish) + "ms");
    }
}